﻿using System.Collections.Generic;
using System.Web.Mvc;
using ABC.Business.Models;
using ABC.Core.Configuration;
using ABC.Domain.Entities;
using ABC.Domain.Json;

namespace ABC.Controllers.ViewModels.My
{
    public class ObjectInsuranceViewModel : BaseViewModel
    {
        protected readonly RbsCalcModel rbsCalcModel;

        public string Id { get; set; }

        public List<InfoClient> Clients { get; set; }

        public string Category { get; set; }

        public List<SelectListItem> ListForCategory { get; set; }

        public string InsurantId { get; set; }

        public string NameInsurant { get; set; }

        public string CategoryTs { get; set; }

        public List<SelectListItem> ListForCategoryTs { get; set; }

        public string CarManufacture { get; set; }

        public string CarModel { get; set; }

        public List<SelectListItem> ListForManufacture { get; set; }

        public List<SelectListItem> ListForModel { get; set; }

        public string Release { get; set; }

        public List<SelectListItem> ListForRelease { get; set; }

        public string Engine { get; set; }

        public List<SelectListItem> ListForEngine { get; set; }

        public string Power { get; set; }

        public string Operation { get; set; }

        public string Pts { get; set; }

        public string Controlwheel { get; set; }

        public string Landing { get; set; }

        public List<SelectListItem> ListForLanding { get; set; }

        public string Maxmass { get; set; }

        public List<SelectListItem> ListForMaxmass { get; set; }

        public string Mass { get; set; }

        public List<SelectListItem> ListForMass { get; set; }

        public string ExistingFiles { get; set; }

        public string Icons { get; set; }

        public List<EditCalc> Calculations { get; set; }

        public ObjectInsuranceViewModel()
        {
            rbsCalcModel = IoC.Resolve<RbsCalcModel>();
            ListForCategory = new List<SelectListItem>
                                  {
                                      new SelectListItem { Text = "Транспортное средство", Value = "Транспортное средство" }
                                  };
            ListForCategoryTs = new List<SelectListItem>
                                  {
                                      new SelectListItem{Text = "A", Value = "A"}, 
                                      new SelectListItem{Text = "B", Value = "B", Selected = true}, 
                                      new SelectListItem{Value = "C", Text = "C"}, 
                                      new SelectListItem{Value = "D", Text = "D"}
                                  };
            ListForManufacture = new List<SelectListItem>();
            ListForManufacture = rbsCalcModel.GetDictionary("Марка"); ListForManufacture.Insert(0, new SelectListItem { Value = "---", Text = "---" });
            ListForModel = new List<SelectListItem>();
            ListForRelease = new List<SelectListItem>();
            ListForRelease = rbsCalcModel.GetDictionary("Год");
            ListForEngine = new List<SelectListItem>
                               {
                                   new SelectListItem   {Value = "---", Text = "---"},
                                   new SelectListItem   {Value = "до 300 см3", Text = "до 300 см³"},
                                   new SelectListItem   {Value = "300 - 349 см3", Text = "300 - 349 см³"},
                                   new SelectListItem   {Value = "350 - 499 см3", Text = "350 - 499 см³"},
                                   new SelectListItem   {Value = "500 - 589 см3", Text = "500 - 589 см³"},
                                   new SelectListItem   {Value = "590 - 899 см3", Text = "590 - 899 см³"},
                                   new SelectListItem   {Value = "900 - 2469 см3", Text = "900 - 2469 см³"},
                                   new SelectListItem   {Value = "от 2470 см3", Text = "от 2470 см³"}
                               };
            ListForLanding = new List<SelectListItem>
                                 {
                                     new SelectListItem{Text = "до 8", Value = "до 8"},
                                     new SelectListItem{Value = "свыше 8", Text = "свыше 8"}
                                 };
            ListForMaxmass = new List<SelectListItem>
                                 {
                                     new SelectListItem{Text = "до 3.5 т", Value = "до 3.5 т"},
                                     new SelectListItem{Value = "свыше 3.5 т", Text = "свыше 3.5 т"}
                                 };
            ListForMass = new List<SelectListItem>
                                 {
                                     new SelectListItem{Text = "до 1.6 т", Value = "до 1.6 т"},
                                     new SelectListItem{Value = "свыше 1.6 т", Text = "свыше 1.6 т"}
                                 };
            Clients = new List<InfoClient>();
            Calculations = new List<EditCalc>();
        }
    }
}
